import Vue from 'vue'
import Router from 'vue-router'
import Index from './views/index.vue'
import Login from './views/login.vue'
import profile from './views/profile.vue'
import classification from './views/classification.vue'
import logout from './views/logout.vue'
import showCar from './views/showCar.vue'
import indent from './views/indent.vue'
import inventory from './views/inventory.vue'
import soleing from './views/soleing.vue'

Vue.use(Router);

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push

Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [{
    path: '/',
    component: Index
  },{
    path: '/inventory',
    component: inventory
  },{
    path: '/soleing',
    component: soleing
  }, {
    path: '/index',
    component: Index
  }, {
    path: '/login',
    component: Login
  }, {
    path: '/logout',
    component: logout
  }, {
    path: '/profile',
    component: profile
  }, {
    path: '/classification',
    component: classification
  }, {
    path: '/showcar',
    component: showCar
  },  {
    path: '/indent',
    component: indent
  }]
});
